Introduction

Project Overview


Introduction to neighborhood change in Los Angeles-Long Beach-Anaheim, CA MSA

This dashboard will be used to detect neighborhood change and gentrification in the Metropolitan Statistical Area (MSA) of Los Angeles-Long Beach-Anaheim. Long Beach has long been my second home and I have watched the city change since my childhood. It is important that the memebers of the City Council have a better understanding of the economic and demographic trends in the city.

Data

Empirical Framework

     TRTID10 state             county Median.HH.Value00 Foreign.Born00
1 6037101110    CA Los Angeles County            153600      0.8326206
2 6037101122    CA Los Angeles County            239400      0.4330839
3 6037101210    CA Los Angeles County            128400      1.0000000
4 6037101220    CA Los Angeles County            143500      0.7331215
5 6037101300    CA Los Angeles County            226900      0.8306451
6 6037101400    CA Los Angeles County            214100      0.7631206
  Recent.Immigrant00 Poor.English00  Veteran00  Poverty00 Poverty.Black00
1         0.21808186     0.17837508 0.24557117 0.35003054      0.00000000
2         0.06816292     0.09060682 0.32418951 0.10390690      0.00000000
3         0.48202138     0.41933916 0.09912536 0.75315841      0.05928086
4         0.15647339     0.26370135 0.15409055 0.50357427      0.00000000
5         0.13642473     0.13508064 0.17137096 0.09206989      0.00000000
6         0.18581560     0.15177305 0.22765957 0.08936170      0.00000000
  Poverty.White00 Poverty.Hispanic00 Pop.Black00 Pop.Hispanic00 Pop.Unemp00
1      0.19059255        0.123396457 0.009163103     0.18020770  0.10079414
2      0.08063175        0.007481297 0.000000000     0.09725685  0.04322527
3      0.28668610        0.327988338 0.063654033     0.32458698  0.18610301
4      0.19777601        0.280381255 0.011119936     0.23828435  0.12787927
5      0.08400537        0.008064516 0.004704301     0.09139785  0.06518817
6      0.08156028        0.000000000 0.003546099     0.13617021  0.10638298
  Pop.Manufact00 Pop.SelfEmp00 Pop.Prof00 Female.LaborForce00 Median.HH.Value10
1     0.09346365     0.1930360  0.4630422           0.6365302            368600
2     0.20448878     0.2842893  0.5344971           0.5885287            465700
3     0.11370262     0.1054422  0.2779397           0.6068999            298200
4     0.10405083     0.1056394  0.2589357           0.4940429            366100
5     0.09475806     0.2836021  0.6081989           0.6666666            482700
6     0.11205674     0.2602837  0.5737589           0.6255319            459300
  Foreign.Born10 Recent.Immigrant10 Poor.English10  Veteran10 Poverty10
1      1.0000000         0.22466422     0.39560440 0.12942613 0.5293040
2      0.9390739         0.05605199     0.09748172 0.19090171 0.1437855
3      1.0000000         0.59318182     0.64500000 0.07954545 0.7504545
4      1.0000000         0.24118130     0.44216571 0.05660377 0.4544709
5      0.9719870         0.12573290     0.12768730 0.21889251 0.1439739
6      1.0000000         0.21612466     0.30555556 0.13482385 0.5101626
  Poverty.Black10 Poverty.White10 Poverty.Hispanic10 Pop.Black10 Pop.Hispanic10
1     0.006715507      0.15811966         0.25518926 0.004884005      0.2142857
2     0.000000000      0.04386677         0.07636068 0.018683997      0.0885459
3     0.050909091      0.21727273         0.45045455 0.045909091      0.3500000
4     0.005742412      0.20590648         0.13863823 0.025430681      0.3059885
5     0.000000000      0.11726384         0.01237785 0.003257329      0.0475570
6     0.066395664      0.33807588         0.04200542 0.048102981      0.1084011
  Pop.Unemp10 Pop.Manufact10 Pop.SelfEmp10 Pop.Prof10 Female.LaborForce10
1   0.1330891     0.13614164     0.2405372  0.6001221           0.6776557
2   0.1291633     0.17709180     0.3525589  0.6986190           0.8976442
3   0.1731818     0.06954545     0.1722727  0.2945455           0.7613636
4   0.1312551     0.02871206     0.2165710  0.2838392           0.7415915
5   0.1022801     0.09771987     0.2814332  0.5524430           0.6742671
6   0.1470190     0.10907859     0.2581301  0.6124661           0.6754743

This data was obtainted from the United States Census Bureau. The time period of analysis for this data is 2000-2010. The units of analysis are based on the ratio of change from 2000 to 2010. The following variables will be analyzed: House Price Change, Foreign Born Change, Recent Immigrant Change, Poor English Change, Veteran Change, Poverty Change, Poverty Change of Black Residents, Poverty Change of White Residents, Poverty Change of Hispanic Residents, Population Change of Black Residents, Population Change of Hispanic Residents, Unemplyment Change, Manufacturing Change, Self Employment Change, Professional Employment Change, and Female Labor Force Change. The main variables of interest are House Price Change, Poverty Change, and Unemployment Change.

View Data


The variables were transformed to reflect the ratio of change that took place from 2000 to 2010. According to the data, house prices nearly doubled in the ten year time period. Poverty and unemployment have also increased.

5-point summary

Statistic Mean St. Dev. Min Max
TRTID10 6,037,403,754.000 220,960.900 6,037,101,110 6,037,980,026
HousePriceChange 1,235.778 32,080.970 0.170 1,000,001.000
FreignBornChange 1.065 0.916 0.000 39.337
RecentImmigrantChange 0.817 0.690 0.000 12.975
PoorEnglishChange 1.241 1.331 0.000 51.338
VeteranChange 0.627 0.355 0.000 7.850
PovertyChange 1.056 0.634 0.000 12.959
PovertyBlackChange 0.708 1.533 0.000 28.513
PovertyWhiteChange 0.921 0.992 0.000 13.316
PovertyHispanicChange 1.144 1.437 0.000 25.850
PopBlackChange 0.816 0.764 0.000 11.888
PopHispanicChange 1.164 0.712 0.000 20.670
PopUnempChange 1.597 1.128 0.000 35.181
PopManufactChange 0.815 0.488 0.000 10.344
PopSelfEmpChange 1.275 0.752 0.000 12.729
PopProfChange 1.207 0.661 0.223 22.928
FemaleLaborForceChange 1.152 0.213 0.442 3.656

According to the 5-point summary, the average ratio of change for poverty is about 1.1 times what it was in 2000. Additionally, we can see that the largest change in poverty was neary 13 times what is was in 2000. Unfortuantely, there have also been increases in unemployment from 2000 to 2010 - unemployment is on average about 1.6 times what it was with the largest increase at 35.18 times what it was in 2000. House prices have also drastically increased.

Histogram


According to the histogram, the change in houseing prices have increased significantly. The poverty and unemployment change variables have a somewhat normal distribution, with most values concentrated in the center.

Correlation Plot


This Correlation Plot shows the relationship between two two variables. According to the Correlation Plot, there is a fairly strong correlation between the Hispanic population and being foreign born. There is also a strong correlation between overall poverty and poverty amongst the Hispanic population.

Regressions

Regression Model Results

Effect of Community Change on Housing Price Change
Dependent variable:
HousePriceChange
(1) (2) (3)
FreignBornChange 124.411 -19.035 61.514
(770.264) (861.461) (901.487)
RecentImmigrantChange 281.589 241.964
(1,081.327) (1,079.867)
PoorEnglishChange 1,490.317*** 1,611.364***
(536.060) (534.892)
VeteranChange -262.961 -177.957
(1,988.583) (2,007.756)
PovertyChange -477.174 -2,088.896 -1,317.168
(1,072.431) (1,422.376) (1,431.825)
PovertyBlackChange 720.300 742.212
(470.917) (469.989)
PovertyWhiteChange 1,233.363 1,149.309
(774.023) (772.417)
PovertyHispanicChange 125.284 128.394
(562.097) (560.364)
PopBlackChange 749.624 828.889 699.488
(884.929) (964.292) (963.894)
PopUnempChange -672.241 -616.857
(628.677) (644.545)
PopManufactChange 1,289.381
(1,500.282)
PopSelfEmpChange 317.898
(943.825)
PopProfChange 4,298.094***
(1,089.559)
FemaleLaborForceChange 2,993.260
(3,406.560)
PopHispanicChange -1,658.697 -1,703.552
(1,178.793) (1,219.157)
Constant 2,068.426 1,012.215 -8,952.858**
(1,788.379) (2,008.036) (4,467.577)
Observations 2,261 2,261 2,261
R2 0.001 0.007 0.017
Adjusted R2 -0.001 0.003 0.011
Residual Std. Error 32,093.450 (df = 2256) 32,037.610 (df = 2250) 31,907.220 (df = 2245)
F Statistic 0.560 (df = 4; 2256) 1.612* (df = 10; 2250) 2.645*** (df = 15; 2245)
Note: p<0.1; p<0.05; p<0.01

Clustering

Identifying Communities

---------------------------------------------------- 
Gaussian finite mixture model fitted by EM algorithm 
---------------------------------------------------- 

Mclust VEV (ellipsoidal, equal shape) model with 4 components: 

 log-likelihood    n  df      BIC      ICL
       37255.42 2261 501 70641.33 70483.48

Clustering table:
  1   2   3   4 
282 762 615 602 

Mixing probabilities:
        1         2         3         4 
0.1256111 0.3369392 0.2725646 0.2648851 

Means:
                          [,1]        [,2]       [,3]       [,4]
Foreign.Born10      0.66391431 0.601589465 0.99948341 0.99958209
Recent.Immigrant10  0.17491702 0.126732518 0.36117898 0.47055285
Poor.English10      0.28719340 0.149981609 0.59686095 0.88815046
Veteran10           0.14073006 0.137315760 0.09961185 0.05893158
Poverty10           0.58293639 0.195183707 0.46564735 0.89821990
Poverty.Black10     0.19919864 0.008059213 0.01398949 0.10224764
Poverty.White10     0.09349299 0.096159596 0.07558147 0.02429193
Poverty.Hispanic10  0.28731813 0.062948705 0.30216706 0.79229205
Pop.Black10         0.33951152 0.038711851 0.03542386 0.13315914
Pop.Hispanic10      0.29136797 0.175065196 0.46933814 0.70572279
Pop.Unemp10         0.18658633 0.122823179 0.18930681 0.24435771
Pop.Manufact10      0.11962965 0.114177191 0.16831692 0.25700092
Pop.SelfEmp10       0.12507484 0.224237388 0.18093813 0.15683172
Pop.Prof10          0.40428639 0.664487165 0.46192501 0.22600602
Female.LaborForce10 0.68961282 0.660885306 0.79062226 0.77236009

Variances:
[,,1]
                    Foreign.Born10 Recent.Immigrant10 Poor.English10
Foreign.Born10         0.108121783       0.0327692891   5.853126e-02
Recent.Immigrant10     0.032769289       0.0277246411   1.710763e-02
Poor.English10         0.058531264       0.0171076272   5.724781e-02
Veteran10             -0.010376691      -0.0066231364  -6.482006e-03
Poverty10              0.051850553       0.0164126642   4.814934e-02
Poverty.Black10        0.009571115       0.0017612040   1.862982e-02
Poverty.White10        0.003875264       0.0106603114  -6.949623e-05
Poverty.Hispanic10     0.047900252       0.0099128927   4.352024e-02
Pop.Black10           -0.032521049      -0.0124391342  -6.953526e-03
Pop.Hispanic10         0.044271007       0.0046669208   3.563761e-02
Pop.Unemp10            0.009573025      -0.0003765227   8.737796e-03
Pop.Manufact10         0.009355138      -0.0006605032   6.100015e-03
Pop.SelfEmp10          0.001842119      -0.0002611408   1.262841e-03
Pop.Prof10            -0.019101402       0.0007967647  -2.971867e-02
Female.LaborForce10    0.014822545       0.0031853017   9.033918e-03
                        Veteran10    Poverty10 Poverty.Black10 Poverty.White10
Foreign.Born10      -0.0103766910  0.051850553    0.0095711147    3.875264e-03
Recent.Immigrant10  -0.0066231364  0.016412664    0.0017612040    1.066031e-02
Poor.English10      -0.0064820064  0.048149339    0.0186298212   -6.949623e-05
Veteran10            0.0123820652 -0.010745129   -0.0039554143   -1.317795e-03
Poverty10           -0.0107451292  0.131327651    0.0428029543    2.000323e-02
Poverty.Black10     -0.0039554143  0.042802954    0.0515661492   -5.543542e-03
Poverty.White10     -0.0013177954  0.020003227   -0.0055435416    2.414208e-02
Poverty.Hispanic10  -0.0067527538  0.093537201    0.0164056839    4.740249e-03
Pop.Black10          0.0003503659 -0.020756174    0.0354620865   -2.645906e-02
Pop.Hispanic10      -0.0025736351  0.049626450    0.0075645155    1.138275e-03
Pop.Unemp10          0.0016451815  0.010392458    0.0063865369   -2.568976e-04
Pop.Manufact10       0.0020009300  0.001899017   -0.0007631776   -1.595938e-04
Pop.SelfEmp10       -0.0005649074 -0.008550615   -0.0051694687   -1.698961e-03
Pop.Prof10           0.0054749063 -0.055893267   -0.0309244315    5.736419e-03
Female.LaborForce10  0.0005622169 -0.006939183   -0.0002673719   -3.379611e-03
                    Poverty.Hispanic10   Pop.Black10 Pop.Hispanic10
Foreign.Born10             0.047900252 -0.0325210495    0.044271007
Recent.Immigrant10         0.009912893 -0.0124391342    0.004666921
Poor.English10             0.043520237 -0.0069535263    0.035637614
Veteran10                 -0.006752754  0.0003503659   -0.002573635
Poverty10                  0.093537201 -0.0207561740    0.049626450
Poverty.Black10            0.016405684  0.0354620865    0.007564515
Poverty.White10            0.004740249 -0.0264590560    0.001138275
Poverty.Hispanic10         0.101563176 -0.0259446682    0.052318370
Pop.Black10               -0.025944668  0.1129366544   -0.025903307
Pop.Hispanic10             0.052318370 -0.0259033071    0.046010861
Pop.Unemp10                0.011489919  0.0010087804    0.007142340
Pop.Manufact10             0.005190372 -0.0078094912    0.007740113
Pop.SelfEmp10             -0.003193775 -0.0069929970   -0.000377298
Pop.Prof10                -0.045264459 -0.0213167379   -0.031706027
Female.LaborForce10       -0.001246377  0.0086173156    0.006898907
                      Pop.Unemp10 Pop.Manufact10 Pop.SelfEmp10    Pop.Prof10
Foreign.Born10       0.0095730254   0.0093551381  0.0018421194 -0.0191014023
Recent.Immigrant10  -0.0003765227  -0.0006605032 -0.0002611408  0.0007967647
Poor.English10       0.0087377963   0.0061000147  0.0012628412 -0.0297186719
Veteran10            0.0016451815   0.0020009300 -0.0005649074  0.0054749063
Poverty10            0.0103924578   0.0018990166 -0.0085506149 -0.0558932671
Poverty.Black10      0.0063865369  -0.0007631776 -0.0051694687 -0.0309244315
Poverty.White10     -0.0002568976  -0.0001595938 -0.0016989607  0.0057364194
Poverty.Hispanic10   0.0114899190   0.0051903718 -0.0031937751 -0.0452644591
Pop.Black10          0.0010087804  -0.0078094912 -0.0069929970 -0.0213167379
Pop.Hispanic10       0.0071423398   0.0077401130 -0.0003772980 -0.0317060272
Pop.Unemp10          0.0099831689   0.0011645587 -0.0015531808 -0.0074499150
Pop.Manufact10       0.0011645587   0.0081149680 -0.0016663353 -0.0009567576
Pop.SelfEmp10       -0.0015531808  -0.0016663353  0.0067737565  0.0106905611
Pop.Prof10          -0.0074499150  -0.0009567576  0.0106905611  0.0639488936
Female.LaborForce10  0.0075027403   0.0055321543  0.0025453085  0.0084106866
                    Female.LaborForce10
Foreign.Born10             0.0148225451
Recent.Immigrant10         0.0031853017
Poor.English10             0.0090339184
Veteran10                  0.0005622169
Poverty10                 -0.0069391826
Poverty.Black10           -0.0002673719
Poverty.White10           -0.0033796112
Poverty.Hispanic10        -0.0012463770
Pop.Black10                0.0086173156
Pop.Hispanic10             0.0068989066
Pop.Unemp10                0.0075027403
Pop.Manufact10             0.0055321543
Pop.SelfEmp10              0.0025453085
Pop.Prof10                 0.0084106866
Female.LaborForce10        0.0347800211
[,,2]
                    Foreign.Born10 Recent.Immigrant10 Poor.English10
Foreign.Born10        0.0644477986       0.0136231378   0.0219500039
Recent.Immigrant10    0.0136231378       0.0081036367   0.0047701921
Poor.English10        0.0219500039       0.0047701921   0.0123104024
Veteran10            -0.0025207753      -0.0021100517  -0.0009977955
Poverty10             0.0091414715       0.0038219393   0.0062270450
Poverty.Black10       0.0003454983       0.0002489582   0.0002206702
Poverty.White10      -0.0006186991       0.0007644042   0.0006328070
Poverty.Hispanic10    0.0074126137       0.0018412965   0.0046636284
Pop.Black10           0.0014780056       0.0008262644   0.0006905760
Pop.Hispanic10        0.0131097718       0.0014099369   0.0083249968
Pop.Unemp10           0.0027429850       0.0004863836   0.0014123470
Pop.Manufact10        0.0020465903      -0.0006740653   0.0006504291
Pop.SelfEmp10        -0.0017263097      -0.0014210820  -0.0026664401
Pop.Prof10           -0.0072053981      -0.0020926051  -0.0070751838
Female.LaborForce10   0.0106438151       0.0009837219   0.0035516040
                        Veteran10     Poverty10 Poverty.Black10 Poverty.White10
Foreign.Born10      -2.520775e-03  0.0091414715    3.454983e-04   -6.186991e-04
Recent.Immigrant10  -2.110052e-03  0.0038219393    2.489582e-04    7.644042e-04
Poor.English10      -9.977955e-04  0.0062270450    2.206702e-04    6.328070e-04
Veteran10            4.766354e-03 -0.0013003359   -1.458362e-04   -8.328479e-04
Poverty10           -1.300336e-03  0.0138081958    5.640001e-04    4.429997e-03
Poverty.Black10     -1.458362e-04  0.0005640001    1.786328e-04    7.970327e-05
Poverty.White10     -8.328479e-04  0.0044299973    7.970327e-05    4.235901e-03
Poverty.Hispanic10   6.619654e-05  0.0072327924    2.151913e-04   -4.981677e-05
Pop.Black10         -3.524836e-04  0.0009314418    1.755479e-04   -3.207038e-05
Pop.Hispanic10       9.672181e-04  0.0075793084    2.426906e-04   -2.111680e-03
Pop.Unemp10         -4.405009e-05  0.0019487896    1.308497e-04    2.027118e-04
Pop.Manufact10       1.972233e-03 -0.0010547884   -1.386640e-04   -1.593470e-03
Pop.SelfEmp10       -2.498574e-04 -0.0033850536   -2.399722e-04    8.530512e-04
Pop.Prof10          -1.375188e-03 -0.0087489594   -4.051490e-04   -1.427647e-03
Female.LaborForce10  9.504494e-04  0.0005079078   -3.421321e-05   -2.303463e-03
                    Poverty.Hispanic10   Pop.Black10 Pop.Hispanic10
Foreign.Born10            7.412614e-03  1.478006e-03   0.0131097718
Recent.Immigrant10        1.841297e-03  8.262644e-04   0.0014099369
Poor.English10            4.663628e-03  6.905760e-04   0.0083249968
Veteran10                 6.619654e-05 -3.524836e-04   0.0009672181
Poverty10                 7.232792e-03  9.314418e-04   0.0075793084
Poverty.Black10           2.151913e-04  1.755479e-04   0.0002426906
Poverty.White10          -4.981677e-05 -3.207038e-05  -0.0021116797
Poverty.Hispanic10        6.855218e-03  5.867245e-04   0.0094964546
Pop.Black10               5.867245e-04  1.192922e-03   0.0007176726
Pop.Hispanic10            9.496455e-03  7.176726e-04   0.0225814132
Pop.Unemp10               1.606072e-03  3.228458e-04   0.0029775136
Pop.Manufact10            7.115354e-04 -2.518686e-04   0.0033994644
Pop.SelfEmp10            -3.366337e-03 -1.179102e-03  -0.0083797936
Pop.Prof10               -6.543927e-03 -1.185107e-03  -0.0127464432
Female.LaborForce10       3.066123e-03  2.697013e-04   0.0093766305
                      Pop.Unemp10 Pop.Manufact10 Pop.SelfEmp10   Pop.Prof10
Foreign.Born10       2.742985e-03   0.0020465903 -0.0017263097 -0.007205398
Recent.Immigrant10   4.863836e-04  -0.0006740653 -0.0014210820 -0.002092605
Poor.English10       1.412347e-03   0.0006504291 -0.0026664401 -0.007075184
Veteran10           -4.405009e-05   0.0019722335 -0.0002498574 -0.001375188
Poverty10            1.948790e-03  -0.0010547884 -0.0033850536 -0.008748959
Poverty.Black10      1.308497e-04  -0.0001386640 -0.0002399722 -0.000405149
Poverty.White10      2.027118e-04  -0.0015934698  0.0008530512 -0.001427647
Poverty.Hispanic10   1.606072e-03   0.0007115354 -0.0033663369 -0.006543927
Pop.Black10          3.228458e-04  -0.0002518686 -0.0011791017 -0.001185107
Pop.Hispanic10       2.977514e-03   0.0033994644 -0.0083797936 -0.012746443
Pop.Unemp10          2.737512e-03   0.0001330508 -0.0012345935 -0.002171684
Pop.Manufact10       1.330508e-04   0.0052323916 -0.0024657644 -0.001165279
Pop.SelfEmp10       -1.234594e-03  -0.0024657644  0.0132809646  0.009803378
Pop.Prof10          -2.171684e-03  -0.0011652791  0.0098033780  0.026439385
Female.LaborForce10  3.180998e-03   0.0039698054 -0.0036266165  0.001254987
                    Female.LaborForce10
Foreign.Born10             1.064382e-02
Recent.Immigrant10         9.837219e-04
Poor.English10             3.551604e-03
Veteran10                  9.504494e-04
Poverty10                  5.079078e-04
Poverty.Black10           -3.421321e-05
Poverty.White10           -2.303463e-03
Poverty.Hispanic10         3.066123e-03
Pop.Black10                2.697013e-04
Pop.Hispanic10             9.376630e-03
Pop.Unemp10                3.180998e-03
Pop.Manufact10             3.969805e-03
Pop.SelfEmp10             -3.626617e-03
Pop.Prof10                 1.254987e-03
Female.LaborForce10        1.762307e-02
[,,3]
                    Foreign.Born10 Recent.Immigrant10 Poor.English10
Foreign.Born10        1.265523e-04       0.0000516585   9.100611e-05
Recent.Immigrant10    5.165850e-05       0.0291630833   1.430295e-02
Poor.English10        9.100611e-05       0.0143029455   3.750064e-02
Veteran10            -1.423378e-05      -0.0030097202  -2.794130e-03
Poverty10            -1.354996e-05       0.0106879440   1.636443e-02
Poverty.Black10      -1.568440e-06       0.0003306072  -1.555249e-04
Poverty.White10       4.356299e-06       0.0048695202   7.139403e-04
Poverty.Hispanic10   -6.544562e-06       0.0018871953   1.526651e-02
Pop.Black10           5.365717e-06       0.0004528021  -1.189426e-03
Pop.Hispanic10        1.385473e-06      -0.0099540119   1.383568e-02
Pop.Unemp10           2.252082e-05       0.0002475717   3.513814e-03
Pop.Manufact10        4.162929e-06      -0.0022796839   2.100398e-03
Pop.SelfEmp10         1.999472e-05       0.0013945713   1.424735e-04
Pop.Prof10           -2.678139e-05      -0.0032605943  -1.428642e-02
Female.LaborForce10   4.097210e-05      -0.0018229330   8.409584e-04
                        Veteran10     Poverty10 Poverty.Black10 Poverty.White10
Foreign.Born10      -1.423378e-05 -1.354996e-05   -1.568440e-06    4.356299e-06
Recent.Immigrant10  -3.009720e-03  1.068794e-02    3.306072e-04    4.869520e-03
Poor.English10      -2.794130e-03  1.636443e-02   -1.555249e-04    7.139403e-04
Veteran10            2.996412e-03 -2.802810e-03   -1.242575e-04   -8.606499e-04
Poverty10           -2.802810e-03  4.017558e-02    1.151780e-03    5.416182e-03
Poverty.Black10     -1.242575e-04  1.151780e-03    6.435347e-04    2.067010e-04
Poverty.White10     -8.606499e-04  5.416182e-03    2.067010e-04    7.898257e-03
Poverty.Hispanic10  -1.613115e-03  3.447259e-02    6.531529e-04   -1.009032e-03
Pop.Black10         -8.948986e-05  6.087560e-04    3.298091e-04    1.371130e-04
Pop.Hispanic10       4.937710e-04  1.439971e-02   -5.177404e-05   -4.929792e-03
Pop.Unemp10         -1.761697e-04  4.160930e-03    1.158689e-04    6.262905e-04
Pop.Manufact10       7.929543e-04 -5.426418e-04   -1.952327e-04   -1.661743e-03
Pop.SelfEmp10       -3.219722e-04 -8.774186e-04   -5.735328e-05   -1.185099e-04
Pop.Prof10           1.619660e-03 -1.427631e-02   -5.740377e-04   -6.401441e-04
Female.LaborForce10  9.120020e-04 -1.839594e-03   -3.053947e-05   -1.917612e-03
                    Poverty.Hispanic10   Pop.Black10 Pop.Hispanic10
Foreign.Born10           -6.544562e-06  5.365717e-06   1.385473e-06
Recent.Immigrant10        1.887195e-03  4.528021e-04  -9.954012e-03
Poor.English10            1.526651e-02 -1.189426e-03   1.383568e-02
Veteran10                -1.613115e-03 -8.948986e-05   4.937710e-04
Poverty10                 3.447259e-02  6.087560e-04   1.439971e-02
Poverty.Black10           6.531529e-04  3.298091e-04  -5.177404e-05
Poverty.White10          -1.009032e-03  1.371130e-04  -4.929792e-03
Poverty.Hispanic10        4.127744e-02  4.121104e-04   2.663759e-02
Pop.Black10               4.121104e-04  1.301673e-03  -9.757039e-04
Pop.Hispanic10            2.663759e-02 -9.757039e-04   4.281512e-02
Pop.Unemp10               4.730274e-03  2.545414e-05   5.774168e-03
Pop.Manufact10            1.938852e-03 -3.107957e-04   6.442735e-03
Pop.SelfEmp10            -1.173329e-03 -8.468479e-05  -4.063205e-03
Pop.Prof10               -1.586006e-02 -4.184954e-04  -1.700294e-02
Female.LaborForce10       1.572422e-03 -2.382925e-04   7.038931e-03
                      Pop.Unemp10 Pop.Manufact10 Pop.SelfEmp10    Pop.Prof10
Foreign.Born10       2.252082e-05   4.162929e-06  1.999472e-05 -2.678139e-05
Recent.Immigrant10   2.475717e-04  -2.279684e-03  1.394571e-03 -3.260594e-03
Poor.English10       3.513814e-03   2.100398e-03  1.424735e-04 -1.428642e-02
Veteran10           -1.761697e-04   7.929543e-04 -3.219722e-04  1.619660e-03
Poverty10            4.160930e-03  -5.426418e-04 -8.774186e-04 -1.427631e-02
Poverty.Black10      1.158689e-04  -1.952327e-04 -5.735328e-05 -5.740377e-04
Poverty.White10      6.262905e-04  -1.661743e-03 -1.185099e-04 -6.401441e-04
Poverty.Hispanic10   4.730274e-03   1.938852e-03 -1.173329e-03 -1.586006e-02
Pop.Black10          2.545414e-05  -3.107957e-04 -8.468479e-05 -4.184954e-04
Pop.Hispanic10       5.774168e-03   6.442735e-03 -4.063205e-03 -1.700294e-02
Pop.Unemp10          4.943651e-03   1.177922e-03 -6.085807e-04 -3.093754e-03
Pop.Manufact10       1.177922e-03   6.233920e-03 -9.683879e-04 -8.107614e-04
Pop.SelfEmp10       -6.085807e-04  -9.683879e-04  5.272026e-03  2.374513e-03
Pop.Prof10          -3.093754e-03  -8.107614e-04  2.374513e-03  2.190772e-02
Female.LaborForce10  2.919023e-03   3.769146e-03 -2.769200e-04  1.506453e-03
                    Female.LaborForce10
Foreign.Born10             4.097210e-05
Recent.Immigrant10        -1.822933e-03
Poor.English10             8.409584e-04
Veteran10                  9.120020e-04
Poverty10                 -1.839594e-03
Poverty.Black10           -3.053947e-05
Poverty.White10           -1.917612e-03
Poverty.Hispanic10         1.572422e-03
Pop.Black10               -2.382925e-04
Pop.Hispanic10             7.038931e-03
Pop.Unemp10                2.919023e-03
Pop.Manufact10             3.769146e-03
Pop.SelfEmp10             -2.769200e-04
Pop.Prof10                 1.506453e-03
Female.LaborForce10        1.334168e-02
[,,4]
                    Foreign.Born10 Recent.Immigrant10 Poor.English10
Foreign.Born10        1.458752e-04       0.0001240310   0.0001530417
Recent.Immigrant10    1.240310e-04       0.0440162361   0.0178483703
Poor.English10        1.530417e-04       0.0178483703   0.0269652008
Veteran10            -1.615956e-05      -0.0026069741  -0.0032069208
Poverty10             7.911668e-05       0.0053934026   0.0114403335
Poverty.Black10      -7.019771e-05      -0.0082518429  -0.0067248566
Poverty.White10       4.699213e-07       0.0001261844  -0.0008500238
Poverty.Hispanic10    1.373100e-04       0.0084328490   0.0225063887
Pop.Black10          -1.116458e-04      -0.0119639054  -0.0120113656
Pop.Hispanic10        1.231885e-04       0.0034631246   0.0178915768
Pop.Unemp10           2.831111e-05       0.0007536096   0.0016498893
Pop.Manufact10        6.656000e-05       0.0064486631   0.0092205655
Pop.SelfEmp10         1.545666e-05       0.0045347489   0.0018340612
Pop.Prof10           -3.719127e-05      -0.0013146531  -0.0042998287
Female.LaborForce10   2.105505e-05       0.0025993446   0.0022939226
                        Veteran10     Poverty10 Poverty.Black10 Poverty.White10
Foreign.Born10      -1.615956e-05  7.911668e-05   -7.019771e-05    4.699213e-07
Recent.Immigrant10  -2.606974e-03  5.393403e-03   -8.251843e-03    1.261844e-04
Poor.English10      -3.206921e-03  1.144033e-02   -6.724857e-03   -8.500238e-04
Veteran10            1.911137e-03 -2.389046e-03    1.025739e-03    1.098161e-04
Poverty10           -2.389046e-03  2.624166e-02    1.801246e-03    3.051362e-05
Poverty.Black10      1.025739e-03  1.801246e-03    1.729403e-02   -1.439786e-04
Poverty.White10      1.098161e-04  3.051362e-05   -1.439786e-04    6.434246e-04
Poverty.Hispanic10  -4.102511e-03  3.603705e-02   -1.837920e-03   -6.319774e-04
Pop.Black10          1.932489e-03 -2.102458e-03    1.640149e-02   -2.727850e-04
Pop.Hispanic10      -3.061241e-03  1.396248e-02   -9.120526e-03   -8.759159e-04
Pop.Unemp10          1.698578e-04  8.488441e-04   -3.588777e-04    5.625961e-05
Pop.Manufact10      -1.047502e-03  1.704790e-03   -4.013860e-03   -4.612464e-04
Pop.SelfEmp10       -2.257949e-04  4.633659e-04   -7.940068e-04   -4.491561e-06
Pop.Prof10           1.157752e-03 -7.927012e-03   -2.679230e-03    2.678432e-04
Female.LaborForce10  2.517085e-04 -4.558280e-03   -3.260881e-03   -2.685163e-04
                    Poverty.Hispanic10   Pop.Black10 Pop.Hispanic10
Foreign.Born10            0.0001373100 -0.0001116458   0.0001231885
Recent.Immigrant10        0.0084328490 -0.0119639054   0.0034631246
Poor.English10            0.0225063887 -0.0120113656   0.0178915768
Veteran10                -0.0041025110  0.0019324894  -0.0030612407
Poverty10                 0.0360370480 -0.0021024581   0.0139624815
Poverty.Black10          -0.0018379197  0.0164014897  -0.0091205258
Poverty.White10          -0.0006319774 -0.0002727850  -0.0008759159
Poverty.Hispanic10        0.0677008754 -0.0081694279   0.0356667986
Pop.Black10              -0.0081694279  0.0219808921  -0.0142886123
Pop.Hispanic10            0.0356667986 -0.0142886123   0.0371762853
Pop.Unemp10               0.0029410089 -0.0009711398   0.0026043914
Pop.Manufact10            0.0082788695 -0.0060563610   0.0122451812
Pop.SelfEmp10             0.0009088261 -0.0008503290  -0.0001016393
Pop.Prof10               -0.0125879429 -0.0009116032  -0.0074488449
Female.LaborForce10      -0.0048306367 -0.0023969766   0.0011640669
                      Pop.Unemp10 Pop.Manufact10 Pop.SelfEmp10    Pop.Prof10
Foreign.Born10       2.831111e-05   0.0000665600  1.545666e-05 -3.719127e-05
Recent.Immigrant10   7.536096e-04   0.0064486631  4.534749e-03 -1.314653e-03
Poor.English10       1.649889e-03   0.0092205655  1.834061e-03 -4.299829e-03
Veteran10            1.698578e-04  -0.0010475016 -2.257949e-04  1.157752e-03
Poverty10            8.488441e-04   0.0017047895  4.633659e-04 -7.927012e-03
Poverty.Black10     -3.588777e-04  -0.0040138600 -7.940068e-04 -2.679230e-03
Poverty.White10      5.625961e-05  -0.0004612464 -4.491561e-06  2.678432e-04
Poverty.Hispanic10   2.941009e-03   0.0082788695  9.088261e-04 -1.258794e-02
Pop.Black10         -9.711398e-04  -0.0060563610 -8.503290e-04 -9.116032e-04
Pop.Hispanic10       2.604391e-03   0.0122451812 -1.016393e-04 -7.448845e-03
Pop.Unemp10          6.498233e-03   0.0014773500 -3.119619e-05  3.014153e-06
Pop.Manufact10       1.477350e-03   0.0156439885 -5.300332e-04 -2.046120e-03
Pop.SelfEmp10       -3.119619e-05  -0.0005300332  4.778789e-03  3.115581e-04
Pop.Prof10           3.014153e-06  -0.0020461204  3.115581e-04  8.360854e-03
Female.LaborForce10  3.278099e-03   0.0045433362  1.434189e-03  4.098976e-03
                    Female.LaborForce10
Foreign.Born10             2.105505e-05
Recent.Immigrant10         2.599345e-03
Poor.English10             2.293923e-03
Veteran10                  2.517085e-04
Poverty10                 -4.558280e-03
Poverty.Black10           -3.260881e-03
Poverty.White10           -2.685163e-04
Poverty.Hispanic10        -4.830637e-03
Pop.Black10               -2.396977e-03
Pop.Hispanic10             1.164067e-03
Pop.Unemp10                3.278099e-03
Pop.Manufact10             4.543336e-03
Pop.SelfEmp10              1.434189e-03
Pop.Prof10                 4.098976e-03
Female.LaborForce10        1.454095e-02

Cluster 1


Living in Poverty with Poor Engligh Skills

Traits of this cluster include a signifigant number of poor English speakers that likely live in poverty. Nearly 50% of this group is Hispanic.

Cluster 2


Hispanic Immigrants

More than 70% of this group are Hispanic and almost 50% of this group are recent immigrants. The remaining traits are at less than 30%.

Cluster 3


Strong Foreign Born Women

This group is made up of nearly 65% working women and about 60% of this group is foreign born. Further, about 65% of this group is considered professional workers. The remaining traits are equally distributed in the lower percents.

Cluster 4


Foreign Women Trying to Catch a Break

Like the previous group, this group also composed of a high percentage of working wormen - about 70%. Unfortunately, there is also a high rate of poverty - almost 60%. This could be accounted to the foreign born trait, which is about 65% of this group.

Neighborhoods

Mapping Clusters


  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |=                                                                     |   1%
  |                                                                            
  |=                                                                     |   2%
  |                                                                            
  |==                                                                    |   3%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |===                                                                   |   5%
  |                                                                            
  |====                                                                  |   5%
  |                                                                            
  |====                                                                  |   6%
  |                                                                            
  |=====                                                                 |   7%
  |                                                                            
  |=====                                                                 |   8%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |======                                                                |   9%
  |                                                                            
  |=======                                                               |   9%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |=======                                                               |  11%
  |                                                                            
  |========                                                              |  11%
  |                                                                            
  |========                                                              |  12%
  |                                                                            
  |=========                                                             |  12%
  |                                                                            
  |=========                                                             |  13%
  |                                                                            
  |=========                                                             |  14%
  |                                                                            
  |==========                                                            |  14%
  |                                                                            
  |==========                                                            |  15%
  |                                                                            
  |===========                                                           |  15%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |============                                                          |  17%
  |                                                                            
  |============                                                          |  18%
  |                                                                            
  |=============                                                         |  18%
  |                                                                            
  |=============                                                         |  19%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |===============                                                       |  21%
  |                                                                            
  |===============                                                       |  22%
  |                                                                            
  |================                                                      |  22%
  |                                                                            
  |================                                                      |  23%
  |                                                                            
  |================                                                      |  24%
  |                                                                            
  |=================                                                     |  24%
  |                                                                            
  |=================                                                     |  25%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |==================                                                    |  26%
  |                                                                            
  |===================                                                   |  27%
  |                                                                            
  |===================                                                   |  28%
  |                                                                            
  |====================                                                  |  28%
  |                                                                            
  |====================                                                  |  29%
  |                                                                            
  |=====================                                                 |  30%
  |                                                                            
  |=====================                                                 |  31%
  |                                                                            
  |======================                                                |  31%
  |                                                                            
  |======================                                                |  32%
  |                                                                            
  |=======================                                               |  32%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |========================                                              |  34%
  |                                                                            
  |========================                                              |  35%
  |                                                                            
  |=========================                                             |  35%
  |                                                                            
  |=========================                                             |  36%
  |                                                                            
  |==========================                                            |  37%
  |                                                                            
  |==========================                                            |  38%
  |                                                                            
  |===========================                                           |  38%
  |                                                                            
  |===========================                                           |  39%
  |                                                                            
  |============================                                          |  39%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |============================                                          |  41%
  |                                                                            
  |=============================                                         |  41%
  |                                                                            
  |=============================                                         |  42%
  |                                                                            
  |==============================                                        |  42%
  |                                                                            
  |==============================                                        |  43%
  |                                                                            
  |==============================                                        |  44%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |===============================                                       |  45%
  |                                                                            
  |================================                                      |  45%
  |                                                                            
  |================================                                      |  46%
  |                                                                            
  |=================================                                     |  47%
  |                                                                            
  |=================================                                     |  48%
  |                                                                            
  |==================================                                    |  48%
  |                                                                            
  |==================================                                    |  49%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |====================================                                  |  51%
  |                                                                            
  |====================================                                  |  52%
  |                                                                            
  |=====================================                                 |  52%
  |                                                                            
  |=====================================                                 |  53%
  |                                                                            
  |=====================================                                 |  54%
  |                                                                            
  |======================================                                |  54%
  |                                                                            
  |======================================                                |  55%
  |                                                                            
  |=======================================                               |  55%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |========================================                              |  56%
  |                                                                            
  |========================================                              |  57%
  |                                                                            
  |========================================                              |  58%
  |                                                                            
  |=========================================                             |  58%
  |                                                                            
  |=========================================                             |  59%
  |                                                                            
  |==========================================                            |  59%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |==========================================                            |  61%
  |                                                                            
  |===========================================                           |  61%
  |                                                                            
  |===========================================                           |  62%
  |                                                                            
  |============================================                          |  62%
  |                                                                            
  |============================================                          |  63%
  |                                                                            
  |=============================================                         |  64%
  |                                                                            
  |=============================================                         |  65%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |==============================================                        |  66%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |===============================================                       |  68%
  |                                                                            
  |================================================                      |  68%
  |                                                                            
  |================================================                      |  69%
  |                                                                            
  |=================================================                     |  69%
  |                                                                            
  |=================================================                     |  70%
  |                                                                            
  |=================================================                     |  71%
  |                                                                            
  |==================================================                    |  71%
  |                                                                            
  |==================================================                    |  72%
  |                                                                            
  |===================================================                   |  72%
  |                                                                            
  |===================================================                   |  73%
  |                                                                            
  |====================================================                  |  74%
  |                                                                            
  |====================================================                  |  75%
  |                                                                            
  |=====================================================                 |  75%
  |                                                                            
  |=====================================================                 |  76%
  |                                                                            
  |======================================================                |  76%
  |                                                                            
  |======================================================                |  77%
  |                                                                            
  |======================================================                |  78%
  |                                                                            
  |=======================================================               |  78%
  |                                                                            
  |=======================================================               |  79%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |=========================================================             |  81%
  |                                                                            
  |=========================================================             |  82%
  |                                                                            
  |==========================================================            |  82%
  |                                                                            
  |==========================================================            |  83%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |===========================================================           |  85%
  |                                                                            
  |============================================================          |  85%
  |                                                                            
  |============================================================          |  86%
  |                                                                            
  |=============================================================         |  86%
  |                                                                            
  |=============================================================         |  87%
  |                                                                            
  |=============================================================         |  88%
  |                                                                            
  |==============================================================        |  88%
  |                                                                            
  |==============================================================        |  89%
  |                                                                            
  |===============================================================       |  89%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |================================================================      |  91%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |=================================================================     |  92%
  |                                                                            
  |=================================================================     |  93%
  |                                                                            
  |==================================================================    |  94%
  |                                                                            
  |==================================================================    |  95%
  |                                                                            
  |===================================================================   |  95%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |====================================================================  |  97%
  |                                                                            
  |====================================================================  |  98%
  |                                                                            
  |===================================================================== |  98%
  |                                                                            
  |===================================================================== |  99%
  |                                                                            
  |======================================================================|  99%
  |                                                                            
  |======================================================================| 100%


Neighborhood Change

Creating Transition Matrix

   
              1           2           3           4
  1 0.742307692 0.111538462 0.030769231 0.115384615
  2 0.049261084 0.825123153 0.125615764 0.000000000
  3 0.041095890 0.117416830 0.757338552 0.084148728
  4 0.041297935 0.004424779 0.174041298 0.780235988

According to the matrix, about 71% of the tracts in cluster 1 in 2000 remained in cluster 1 ten years later in 2010, while 82% of the tracts in cluster 2 remained the same over the ten year period. 79% of tracts in clusters 3 and 4 remained the same over the ten year period.

Neighborhood Transitions


It is likely that cluster 1 will experience gentrification. As previously noted, cluster 1 experiened high rates of poverty and only 71% of tracts remained in cluster 1 over the ten year time period.

About

About the Developer


Nicole Hill is currenty pursuing her Master’s in Program Evaluation and Data Analytics at Arizona State University. She resides in California with her husband and puppy, Peppermint.

Nicole can be contacted via email at:

---
title: "Community Analytics Practicum Extravaganza"
output: 
  flexdashboard::flex_dashboard:
    social: menu
    source: embed
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(  message=F, warning=F, echo=F )

#Load in libraries
library( tidycensus )
library( tidyverse )
library( ggplot2 )
library( plyr )
library( stargazer )
library( corrplot )
library( purrr )
library( flexdashboard )
library( leaflet )
library( mclust )
library( pander )
library( DT )
```

```{r, quietly=T, include=F}
census_key <- "e511866c0af14a9b3845572aaa38fb9bd77c86f9"
census_api_key(census_key)

#Loading data 
URL <- "https://github.com/DS4PS/cpp-529-master/raw/master/data/CensusData.rds"
census.dats <- readRDS(gzcon(url( URL )))
census.dats <- na.omit(census.dats)
```






Introduction {.storyboard}
=========================================



### Project Overview

```{r}
leaflet() %>%
  addTiles() %>%
  addMarkers(lng=-118.1937, lat=33.7701, popup="Los Angeles-Long Beach-Anaheim, CA MSA")
```


***

Introduction to neighborhood change in Los Angeles-Long Beach-Anaheim, CA MSA

This dashboard will be used to detect neighborhood change and gentrification in the Metropolitan Statistical Area (MSA) of Los Angeles-Long Beach-Anaheim. Long Beach has long been my second home and I have watched the city change since my childhood. It is important that the memebers of the City Council have a better understanding of the economic and demographic trends in the city.  






Data {.storyboard}
=========================================


### Empirical Framework 

```{r, echo=F}
# only view MSA for Los Angeles County

census.dats <- filter(census.dats, county == "Los Angeles County")

head (census.dats)

```


```{r, echo=F}
#Calculating change Values for variables 

censusChange1<-ddply(census.dats,"TRTID10",summarise, 
       HousePriceChange = Median.HH.Value10/(Median.HH.Value00+1),# Change variable
       FreignBornChange = Foreign.Born10/(Foreign.Born00 +.01),
       RecentImmigrantChange = Recent.Immigrant10/(Recent.Immigrant00+.01),
       PoorEnglishChange = Poor.English10/(Poor.English00+.01),
       VeteranChange = Veteran10/(Veteran00+.01),
       PovertyChange = Poverty10/(Poverty00+.01),
       PovertyBlackChange = Poverty.Black10/(Poverty.Black00+.01),
       PovertyWhiteChange = Poverty.White10/(Poverty.White00+.01),
       PovertyHispanicChange = Poverty.Hispanic10/(Poverty.Hispanic00+.01),
       PopBlackChange = Pop.Black10/(Pop.Black00+.01),
       PopHispanicChange = Pop.Hispanic10/(Pop.Hispanic00+.01),
       PopUnempChange = Pop.Unemp10/(Pop.Unemp00+.01),
       PopManufactChange = Pop.Manufact10/(Pop.Manufact00+.01),
       PopSelfEmpChange = Pop.SelfEmp10/(Pop.SelfEmp00+.01),
       PopProfChange = Pop.Prof10/(Pop.Prof00+.01),
       FemaleLaborForceChange = Female.LaborForce10/(Female.LaborForce00+.01)
)

#remove NAs that result 
censusChange1<-censusChange1[!duplicated(censusChange1$TRTID10),]
```


***

This data was obtainted from the United States Census Bureau. The time period of analysis for this data is 2000-2010. The units of analysis are based on the ratio of change from 2000 to 2010. The following variables will be analyzed: House Price Change, Foreign Born Change, Recent Immigrant Change, Poor English Change, Veteran Change, Poverty Change, Poverty Change of Black Residents, Poverty Change of White Residents, Poverty Change of Hispanic Residents, Population Change of Black Residents, Population Change of Hispanic Residents, Unemplyment Change, Manufacturing Change, Self Employment Change, Professional Employment Change, and Female Labor Force Change. The main variables of interest are House Price Change, Poverty Change, and Unemployment Change. 



### View Data 

```{r}
DT::datatable( head(censusChange1, 25) )
```


***

The variables were transformed to reflect the ratio of change that took place from 2000 to 2010. According to the data, house prices nearly doubled in the ten year time period. Poverty and unemployment have also increased. 




### 5-point summary  

```{r, results='asis',message=F, warning=F, fig.width = 9,fig.align='center', echo=F }
#Visualize 5-point summary
censusChange1 %>%
    keep(is.numeric) %>% 
stargazer(
          omit.summary.stat = c("p25", "p75"), nobs=F, type="html") # For a pdf document, replace html with latex
```


***
According to the 5-point summary, the average ratio of change for poverty is about 1.1 times what it was in 2000. Additionally, we can see that the largest change in poverty was neary 13 times what is was in 2000. Unfortuantely, there have also been increases in unemployment from 2000 to 2010 - unemployment is on average about 1.6 times what it was with the largest increase at 35.18 times what it was in 2000. House prices have also drastically increased.   





### Histogram 

```{r,message=F, warning=F, echo=F}
#Histogram
censusChange1 %>%
  keep(is.numeric) %>% 
  gather() %>% 
  ggplot(aes(value)) +
    facet_wrap(~ key, scales = "free") +
    geom_histogram()
```


***
According to the histogram, the change in houseing prices have increased significantly. The poverty and unemployment change variables have a somewhat normal distribution, with most values concentrated in the center. 




### Correlation Plot 

```{r, message=F, warning=F, echo=F}
##save correlations in train_cor
train_cor <- cor(censusChange1[,-1])

##Correlation Plot
corrplot(train_cor, type='lower')

```


***
This Correlation Plot shows the relationship between two two variables. According to the Correlation Plot, there is a fairly strong correlation between the Hispanic population and being foreign born. There is also a strong correlation between overall poverty and poverty amongst the Hispanic population. 


Regressions
=========================================


### Regression Model Results 

```{r, results='asis', fig.align='center'}

reg1<-lm(HousePriceChange ~  FreignBornChange + PovertyChange + PopBlackChange + PopUnempChange 
            , data=censusChange1)

reg2<-lm(HousePriceChange ~  FreignBornChange + RecentImmigrantChange + PoorEnglishChange  + VeteranChange + PovertyChange + PovertyBlackChange + PovertyWhiteChange + PovertyHispanicChange + PopBlackChange + PopHispanicChange  , data=censusChange1)

reg3<-lm(HousePriceChange ~  FreignBornChange + RecentImmigrantChange + PoorEnglishChange  + VeteranChange + PovertyChange + PovertyBlackChange + PovertyWhiteChange + PovertyHispanicChange + PopBlackChange + PopHispanicChange +
PopHispanicChange + PopUnempChange +  PopManufactChange +  PopSelfEmpChange + PopProfChange + FemaleLaborForceChange   , data=censusChange1)

# present results with stargazer
# library(stargazer)
stargazer( reg1, reg2, reg3, 
           title="Effect of Community Change on Housing Price Change",
           type='html', align=TRUE )

```



***




Clustering {.storyboard}
=========================================



### Identifying Communities

```{r ,message=F, warning=F, echo=F, fig.align='center'}
# Cluster analysis for 2010 Data
# library(mclust)

Census2010<-census.dats
keep.these1 <-c("Foreign.Born10","Recent.Immigrant10","Poor.English10","Veteran10","Poverty10","Poverty.Black10","Poverty.White10","Poverty.Hispanic10","Pop.Black10","Pop.Hispanic10","Pop.Unemp10","Pop.Manufact10","Pop.SelfEmp10","Pop.Prof10","Female.LaborForce10")

#Run Cluster Analysis
mod2 <- Mclust(Census2010[keep.these1],G=4) # Set groups to 5, but you can remove this to let r split data into own groupings

summary(mod2, parameters = TRUE)

#Add group classification to df
Census2010$cluster <- mod2$classification
```


```{r ,message=F, warning=F, echo=F, fig.align='center'}

#Visualize Data
stats1 <- 
  Census2010 %>% 
  group_by( cluster ) %>% 
  select(keep.these1)%>% 
  summarise_each( funs(mean) )

t <- data.frame( t(stats1), stringsAsFactors=F )
names(t) <- paste0( "GROUP.", 1:4 )
t <- t[-1,]
```


***




### Cluster 1

```{r ,message=F, warning=F, echo=F, fig.align='center'}

plot( rep(1,15), 1:15, bty="n", xlim=c(-.2,.7), 
      type="n", xaxt="n", yaxt="n",
      xlab="Score", ylab="",
      main=paste("GROUP",1) )
abline( v=seq(0,.7,.1), lty=3, lwd=1.5, col="gray90" )
segments( y0=1:15, x0=0, x1=100, col="gray70", lwd=2 )
text( 0, 1:15, keep.these1, cex=0.85, pos=2 )
points( t[,1], 1:15, pch=19, col="Steelblue", cex=1.5 )
axis( side=1, at=c(0,.1,.3,.2,.4,.5,.6,.7), col.axis="gray", col="gray" )

```


***

Living in Poverty with Poor Engligh Skills


Traits of this cluster include a signifigant number of poor English speakers that likely live in poverty. Nearly 50% of this group is Hispanic. 




### Cluster 2

```{r ,message=F, warning=F, echo=F, fig.align='center'}

plot( rep(1,15), 1:15, bty="n", xlim=c(-.2,.7), 
      type="n", xaxt="n", yaxt="n",
      xlab="Score", ylab="",
      main=paste("GROUP",2) )
abline( v=seq(0,.7,.1), lty=3, lwd=1.5, col="gray90" )
segments( y0=1:15, x0=0, x1=100, col="gray70", lwd=2 )
text( 0, 1:15, keep.these1, cex=0.85, pos=2 )
points( t[,2], 1:15, pch=19, col="Steelblue", cex=1.5 )
axis( side=1, at=c(0,.1,.3,.2,.4,.5,.6,.7), col.axis="gray", col="gray" )

```


***
Hispanic Immigrants


More than 70% of this group are Hispanic and almost 50% of this group are recent immigrants. The remaining traits are at less than 30%.



### Cluster 3 

```{r ,message=F, warning=F, echo=F, fig.align='center'}

plot( rep(1,15), 1:15, bty="n", xlim=c(-.2,.7), 
      type="n", xaxt="n", yaxt="n",
      xlab="Score", ylab="",
      main=paste("GROUP",3) )
abline( v=seq(0,.7,.1), lty=3, lwd=1.5, col="gray90" )
segments( y0=1:15, x0=0, x1=100, col="gray70", lwd=2 )
text( 0, 1:15, keep.these1, cex=0.85, pos=2 )
points( t[,3], 1:15, pch=19, col="Steelblue", cex=1.5 )
axis( side=1, at=c(0,.1,.3,.2,.4,.5,.6,.7), col.axis="gray", col="gray" )

```


***
Strong Foreign Born Women

This group is made up of nearly 65% working women and about 60% of this group is foreign born. Further, about 65% of this group is considered professional workers. The remaining traits are equally distributed in the lower percents.  



### Cluster 4 

```{r ,message=F, warning=F, echo=F, fig.align='center'}

plot( rep(1,15), 1:15, bty="n", xlim=c(-.2,.7), 
      type="n", xaxt="n", yaxt="n",
      xlab="Score", ylab="",
      main=paste("GROUP",4) )
abline( v=seq(0,.7,.1), lty=3, lwd=1.5, col="gray90" )
segments( y0=1:15, x0=0, x1=100, col="gray70", lwd=2 )
text( 0, 1:15, keep.these1, cex=0.85, pos=2 )
points( t[,4], 1:15, pch=19, col="Steelblue", cex=1.5 )
axis( side=1, at=c(0,.1,.3,.2,.4,.5,.6,.7), col.axis="gray", col="gray" )

```


***
Foreign Women Trying to Catch a Break

Like the previous group, this group also composed of a high percentage of working wormen - about 70%. Unfortunately, there is also a high rate of poverty - almost 60%. This could be accounted to the foreign born trait, which is about 65% of this group. 




Neighborhoods {.storyboard}
=========================================


### Mapping Clusters

```{r, message=F, warning=F, echo=F}

lalb.pop <-
get_acs( geography = "tract", variables = "B01003_001",
         state = "CA", county = "Los Angeles County", geometry = TRUE ) %>% 
         select( GEOID, estimate ) 


# convert to numeric
Census2010$TRTID10 <- as.numeric( Census2010$TRTID10 )
lalb.pop$GEOID <- as.numeric( lalb.pop$GEOID )

#merge
lalb <- merge( lalb.pop, Census2010, by.x="GEOID", by.y="TRTID10" )

plot( lalb )



```









```{r ,message=F, warning=F, echo=F, fig.align='center'}
#Predicting cluster Grouping for 2000 census tracts

# Get 2000 data
Census2000 <-census.dats


keep.these00 <-c("Foreign.Born00","Recent.Immigrant00","Poor.English00","Veteran00","Poverty00","Poverty.Black00","Poverty.White00","Poverty.Hispanic00","Pop.Black00","Pop.Hispanic00","Pop.Unemp00","Pop.Manufact00","Pop.SelfEmp00","Pop.Prof00","Female.LaborForce00")

pred00<-predict(mod2, Census2000[keep.these00])

Census2000$PredCluster <- pred00$classification

TransDF2000<-Census2000 %>%
  select(TRTID10, PredCluster)

TransDF2010<-Census2010 %>%
  select(TRTID10, cluster,Median.HH.Value10) 

TransDFnew<-merge(TransDF2000,TransDF2010,by.all="TRTID10",all.x=TRUE)
```


***




Neighborhood Change {.storyboard}
=========================================


### Creating Transition Matrix

```{r ,message=F, warning=F, echo=F, fig.align='center'}

#Transition Matrix
prop.table( table( TransDFnew$PredCluster, TransDFnew$cluster ) , margin=1 )
    
```


***

According to the matrix, about 71% of the tracts in cluster 1 in 2000 remained in cluster 1 ten years later in 2010, while 82% of the tracts in cluster 2 remained the same over the ten year period. 79% of tracts in clusters 3 and 4 remained the same over the ten year period.  




### Neighborhood Transitions

```{r, message=F, warning=F, echo=F, fig.align='center'}

# Sankey Transition Plot
trn_mtrx1 <-
  with(TransDFnew,
       table(PredCluster, 
             cluster))

library(Gmisc)
transitionPlot(trn_mtrx1, 
               type_of_arrow = "gradient")
```


***
It is likely that cluster 1 will experience gentrification. As previously noted, cluster 1 experiened high rates of poverty and only 71% of tracts remained in cluster 1 over the ten year time period.  



About {.storyboard}
=========================================





### About the Developer 


![](http://moviecultists.com/wp-content/uploads/2010/08/Will+Ferrell-150x150.jpg)

***

Nicole Hill is currenty pursuing her Master's in Program Evaluation and Data Analytics at Arizona State University. She resides in California with her husband and puppy, Peppermint. 

Nicole can be contacted via email at: nicoleis@asu.edu




### Documentation {data-commentary-width=400}

```{r, eval=F, echo=T}
# R libraries used for this project
library( tidycensus ) # Load US Census boundary and attribute data
library( tidyverse ) # Designed to make it easy to install/load core packages from the tidyverse in a single command
library( ggplot2 ) # Create elegant data visualisations
library( plyr ) # Tools for splitting, applying, and combining data
library( stargazer ) # Regression and summary statistics tables
library( corrplot ) # Visualization of a correlation matrix
library( purrr ) # Provides a complete and consistent set of tools for working with functions and vectors
library( flexdashboard ) # Creates interactive dashboards
library( leaflet ) # Creates interactive web maps
```


***
Please see comments to the left for package descriptions. 


tidycensus, corrplot, and leaflet are available through github.com


tidyverse, ggplot2, plyr, stargazer, purrr, and flexdashboard are available through CRAN


A Census API Key is needed to run select packages. An API Key can be obtained by visiting: https://api.census.gov/data/key_signup.html